home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Wonky Flux Batch 2019 02
/
Wonky_Flux_Batch_2019-02.zip
/
Wonky Flux Batch 2019-02
/
089 - Misc Stuff - PD.dsk
/
SCRAMBLE.S
< prev
next >
Wrap
Text File
|
2019-02-17
|
2KB
|
62 lines
********************************
* *
* SCRAMBLE *
* *
* An example of the use of the *
* USR opcode. 1/11/82 *
* *
********************************
* *
* Assemble this and save it as *
* SCRAMBLE. To use it, just *
* BRUN SCRAMBLE before doing *
* the assembly of your program *
* *
* Then, for example, *
* *
* USR "WORD" *
* *
* will place a scrambled form *
* of "WORD" in the object code *
* which can be unscrambled by *
* EORing it with #$15 (to get *
* negative ASCII). *
* *
********************************
USRADRS = $B6DA
PUTBYTE = $E5F6
EVAL = $E5F9
WORKSP = $280
OPNDLEN = $BB
ORG $890
LDA #$4C
STA USRADRS
LDA #SCRAMBLE
STA USRADRS+1
LDA #>SCRAMBLE
STA USRADRS+2
RTS
ERR SCRAMBLE-$8A0
SCRAMBLE INY
CPY OPNDLEN
BGE BADOPND
LDA WORKSP,Y
CMP WORKSP ;2nd delimiter?
BEQ DONE
EOR #$95 ;Scramble it
JSR PUTBYTE ;Put it in obj
BNE SCRAMBLE ;Always taken
DONE RTS
BADOPND LDX #0
LDA #""" ;Invalid in expression
STA WORKSP
JMP EVAL ;Force an error
ERR *-1/$900